package com.thunisoft.design.singleton;

import java.lang.reflect.Constructor;

/**
 * @title Client.java
 * @package com.thunisoft.design.singleton
 * @projectName spring.boot
 * @author yzj
 * @date 2020年5月22日 下午2:36:08
 */
public class ReflectClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		
		Class<?> clazz = LazyInnerClassSingleton.class;
		Constructor c = clazz.getDeclaredConstructor(null);
		c.setAccessible(true);
		LazyInnerClassSingleton o1 = (LazyInnerClassSingleton) c.newInstance();
		LazyInnerClassSingleton o2 = (LazyInnerClassSingleton) c.newInstance();
		
		System.out.println(o1 == o2);
		o1.print();
		o2.print();

	}

}
